How to show hierarchy in Drupal’s Solr Search Api Facets?

Standaard
  • Go to admin/config/search/search_api/index/*your solr server*/workflow.
  • Check the box ‘Index Hierarchy’.
  • Select the taxonomy fields where you would like to apply the hierarchy.

Is Drupal’s l() function causing ‘operator not support for strings common.inc’?

Standaard

Previously I was confronted with an error while simply using the Drupal l() function. In this l() function I was trying to give the HTML a-tag a specific class attribute value. The following code was in my module:

l(‘some url text’, ‘the-path-for-the-current-active-page’, array(‘attributes’ => array(‘class’ => ‘custom-class’)))

When calling the page containing the link from above, I received the ‘operator not supported for strings’ error. It seemed that the l() function that at default tried to set the class attribute ‘active’, was causing the error. By removing the parameter for setting the class attribute, the problem got solved. My link now looks like:

l(‘some url text’, ‘the-path-for-the-current-active-page’)

This doesn’t cause any errors anymore.

Why is the mtime added in my Drupal module’s .info file?

Standaard

Since the Drupal Core update of version 7.34 all modules being updated contain an mtime text rule in the .info file.

This is caused by the Drupal core system.module file.

// Add the info file modification time, so it becomes available for
// contributed modules to use for ordering module lists.
$module->info[‘mtime’] = filemtime(dirname($module->uri) . ‘/’ . $module->name . ‘.info’);

How to remove branches in git that are no longer remote?

Standaard

git fetch -p

This does the magic, and unmerged local branches will not be removed.

Creating aliasses in Linux

Standaard

An alias in Linux gives you the possibility to shorten your command’s syntax.

For example, if you need to enter following code in your terminal to compile less code to css:

node less-watch-compiler.js less css

You can shorten this so you only need to enter the following code in your terminal:

less-watch-compiler less css

How do we do that? Simple, just follow the steps below:

  • Open /etc/profile in an editor
    • sudo nano /etc/profile
  • Add the following rule to your /etc/profile file
    • alias your-short-command-name=”the/command/directory/command parameter1 parameter2 …”
  • Exit and save your /etc/profile file
  • Execute “source /etc/profile”
  • That’s it

Based on the above example, I’ve added the next rule to /etc/profile:

alias less-watch-compiler=”node /Location/to/the/tool/Dead-Simple-LESS-Watch-Compiler/less-watch-compiler.js”

If everyone started to work together, money would just become unnecessary!

Standaard

Money is by far the worst invention ever and everyone depends on it. Why? We now need money to evolve but is that really necessary?

Evolution is something that has always happened instinctively and eventually it’s the stronger one that survives. But how do you become stronger? Not by gathering money but by gathering strengths. And knowing that knowledge is a strength, why not leave money beside and let companies globally work together without exchanging that unnecessary object.

How to create an anchor link per node in Drupal views

Standaard

Creating anchor links in views in Drupal can be very easy. You can to it this way:

  • In the view render the output as fields.
  • Add the field ‘Content: path’.
  • Open the fieldset ‘Rewrite results’.
  • Check the rewrite output checkbox.
  • Enter the following text in the rewrite output textarea:
    • <a href='[path]#youranchor’>Your custom link text</a>

The [path] token is the path alias of the node and can be found in the replace patterns section.

How to get the full taxonomy term level path in the url with autopath in Drupal 7.

Standaard

If you want to show all levels of the taxonomy term in the path, you can simply enter the following to your taxonomy url pattern in admin/config/search/path/patterns

[term:parents:join:/]/[term:name]

Does your Drupal views combine filter appears to be case sensitive?

Standaard

It seems to be an issue with MySQL wich is possible to ignore by adding the following code. Just create a module and add a hook_views_query_alter in your module:

function yourmodulename_views_query_alter(&$view, &$query) {
  // Find all combine fields and make them case insensitive.
  foreach ($query->where as $group_key => $group) {
    foreach ($group['conditions'] as $key => $condition) {

          if (is_string($condition[‘field’]) && (preg_match(‘/:views_combine/’, $condition[‘field’]))) {

            $query->where[$group_key][‘conditions’][$key][‘field’] = $condition[‘field’] . ‘ COLLATE utf8_general_ci’;
        }
    }
  }
}

More info can be found on:

https://drupal.org/comment/7998079#comment-7998079

Urgently in need for a CSS solution to fix the border radius on an image in IE10?

Standaard

To solve the issue where IE10 doesn’t apply the border radius on an image you need to add the radius parameter for all areas (top left, top right, bottom left, bottom right). And don’t add 0px but add 0.1px for the areas where no border-radius is needed.

For example, I only needed a border-radius-bottom-right of 20px so what I ended up doing was:

img {border-radius: 0.1px 0.1px 20px 0.1px;}

More info: http://stackoverflow.com/questions/12640815/border-radius-is-not-applied-to-img-element